#pragma once

#include <QDockWidget>
#include "cameraanimationactor.h"
#include <QLineEdit>
#include <QPushButton>
#include <osg\Vec3>
#include <QDialog>

class QTreeWidget;
class QCheckBox;
class QTreeWidgetItem;

namespace CoreBase
{
	class ActorBase;
}
class SelectFileDialog : public QDialog
{
	Q_OBJECT
public:
	SelectFileDialog(QWidget* parent=0,Qt::WindowFlags f=0);
	~SelectFileDialog();
	QString getSelectFileName();
protected:
	virtual void showEvent(QShowEvent* event);
private:
	QLineEdit*											_fileFullPath;
	QPushButton*										_importButton;
	QPushButton*										_okButton;
	QPushButton*										_cancelButton;
private slots:
	void slotsImport();
};

class SetCameraAnimationAttitudeDialog : public QDockWidget
{
	Q_OBJECT
public:
	SetCameraAnimationAttitudeDialog(QWidget* parent=0,Qt::WindowFlags f=0);
	~SetCameraAnimationAttitudeDialog();

	enum DialogOperate
	{
		EditAnimationAttitude,
		AddAnimationAttitude,
	};
	void addNewCameraAttitude(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up);
	void editCameraAttitude();
	void addNewCameraAnimationWithLine(CoreBase::ActorBase* lineactor);
private:
	void initGui();
	void refreshState();
	void refreshTree();
	QPushButton*							_joinButton;
	QPushButton*							_implortButton;
	QPushButton*							_lookatButton;
	QPushButton*							_renameButton;
	QPushButton*							_addButton;
	QPushButton*							_closeButton;
	QPushButton*							_removeButton;
	QPushButton*							_upButton;
	QPushButton*							_downButton;
	//QLineEdit*								_frameNumberEdit;
	QTreeWidget*							_treeWidget;
	CoreBase::ActorBase*					_cameraAnimationLayer;
	DialogOperate							_state;
	osg::Vec3								_newEye;
	osg::Vec3								_newCenter;
	osg::Vec3								_newUp;
	SelectFileDialog*						_selectFileDialog;
private slots:
	void slotsRemove(bool);
	void slotsCurrentMapChanged();
	void slotsAdd(bool);
	void slotsJoin(bool);
	void slotsItemSelectionChanged(QTreeWidgetItem*,int);
	void slotsRenameButton(bool);
	//void slotsEditingFinished();
	void slotsLookatButton(bool);
	void slotsClose(bool);
	void slotsImport(bool);
	void slotsUp(bool);
	void slotsDown(bool);
};